 
<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researcher.domain.*,cn.ac.cintcm.dataconverge.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.ac.cintcm.dataconverge.researcher.domain.Comment,java.util.*,com.hs.core.page.PageUtil,com.hs.core.utils.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
boolean isAdmin = AuthCheck.isInGroup(request,Constants.SYSTEM_MANAGER);
PageUtil pageUtil = (PageUtil)request.getAttribute("pageUtil");
String pageStr = ""; 
int perpageCount = 1;
int currentPage = 1;
List list = null;
if(null != pageUtil){
   list = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
} 
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 
System.out.println("orderName:" + orderName);
System.out.println("orderNum:" + orderNum);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>留言本管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">    
     <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
      <script src="<%=basePath%>js/common.js" language="javascript" type="text/javascript"></script>
    <script language="javascript">
    	function del(id1){
    		if(window.confirm("确定删除此留言？","确定","取消")){		    		
	  			document.location.href="comments.htm?action=delComment&commentId="+id1;
	  			submitPageForm();
	  		}
    	}
    	function rel(id){
    		 openwindow('<%=path%>/comments.htm?action=view&cid='+id,'600','350');
    	}
    </script>
  </head>
 
<body  scroll="yes">
      <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <img src="<%=basePath%>index/Themes/com/idt_tb_pass.gif" />&nbsp;留言本管理
        </div>
    </div>
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
     <tbody><form name="searchform" action="comments.htm?1=1" method="post">
        <tr>
		<td class="fim_l"> 留言者:</td>
            <td class="fim_r">
                <input type="text" class="com_textbox" id="commentator" name="commentator" value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("commentator")) %>"></td>
                <td class="fim_l"> 留言时间:</td>
            <td class="fim_r">从
                <input type="text" class="com_textbox" id="commentDateS" readonly="readonly" name="commentDateS"  onFocus="WdatePicker({el:'commentDateS',dateFmt:'yyyy-MM-dd'})"  value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("commentDateS")) %>">
                至
                <input type="text" class="com_textbox" id="commentDateE" readonly="readonly" name="commentDateE"  onFocus="WdatePicker({el:'commentDateE',dateFmt:'yyyy-MM-dd'})"  value="<%=StringUtilTool.setObjNULLStr(request.getAttribute("commentDateE")) %>"></td>
            <td class="fim_r" align="right" colspan="2">
                <input type="submit" value="查询" name="B3" class="com_btn2" id="Button5">
                <input type="button" value="我要留言" name="B4" class="com_btn2" id="Button2" onclick="javascript:openwindow('comments.htm?action=comment','600','350');">
			
            </td>
        </tr></form></tbody>
    </table>
    <div class="content">
        <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4" >
            <tr>
                <td class="dg_headerstyle">
                    序号</td>
                <td class="dg_headerstyle" >
                    内容 </td>
                  <td class="dg_headerstyle" >
                    <a href="javaScript:orderPage('commentDate','<%=OrderTool.getOrderNum("commentDate",orderName,orderNum)%>');">留言时间&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("commentDate",orderName,orderNum))%></a></td>
                  <td class="dg_headerstyle" >
                    <a href="javaScript:orderPage('commentator','<%=OrderTool.getOrderNum("commentator",orderName,orderNum)%>');">留言者&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("commentator",orderName,orderNum))%></td>
                     <%if(isAdmin){ %>
                     <td class="dg_headerstyle">答复</td>
                 <td class="dg_headerstyle">删除</td>
                 <%} %>
            </tr>
            <% 
            if(list != null && list.size()>0){ 
            	for(int i = 0;i<list.size();i++){
            	Comment comment= (Comment)list.get(i);
            %>
            <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                <td align="center" width="5%">
                   <%= perpageCount*(currentPage-1)+i+1 %></td>
                <td>
                    <%=comment.getContent() %>
                </td>
                <td width="6%" align="center">
                    <%=comment.getCommentDate() %>
                </td>
                <td width="6%" align="center">
                    <%=comment.getCommentator() %>
                </td>
                <%if(isAdmin){ %>
                 <td align="center" width="5%"><img style="cursor: hand" src="<%=basePath%>index/Themes/com/table_(edit)_16x16.gif" onclick="javascript:rel('<%=comment.getId() %>');"
               alt="回复" />
                <td align="center" width="5%"><img style="cursor: hand" src="<%=basePath%>index/Themes/com/table_(delete)_16x16.gif" onclick="javascript:del('<%=comment.getId() %>');"
               alt="删除" />
                </td>
                <%} %>
            </tr>
             <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                 <td  align="center">
                    答复:
                </td>
                <td colspan=5>
                    <%=comment.getMemo()==null?"":comment.getMemo() %>
                </td>
                 
            </tr>
            <%}}else{ %>
            <tr class="dg_alternatingitemstyle" align="center">
                <td colspan="5"><font color="red">没有找到记录</font></td>
                
            </tr>
            <%} %>
        </table>
        <div class="dg_pagerstyle" align="right">
        <%=pageStr%>
        </div>
    </div>
  </body>
</html>
